<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>基本属性网格 - jQuery EasyUI 演示</title>
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
	<link rel="stylesheet" type="text/css" href="../demo.css">
	<script type="text/javascript" src="../../jquery.min.js"></script>
	<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../../locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
	<h2 title="Basic PropertyGrid">基本属性网格</h2>
	<p title="Click on row to change each property value.">　　在行上点击即可修改每个属性的值（<i>注：项『信用评级』绑定的组合框在“自定义列”示例中</i>）。</p>
	<div style="margin:20px 0;">
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="showGroup()">显示分组</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="hideGroup()">隐藏分组</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="showHeader()">显示表头</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="hideHeader()">隐藏表头</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="getChanges()">获取变更信息</a>
	</div>
	<table id="pg" class="easyui-propertygrid" style="width:400px" data-options="
				url:'propertygrid_data1.json',
				method:'get',
				showGroup:true,
				scrollbarSize:0
			">
	</table>

	<script type="text/javascript">
		function showGroup(){
			$('#pg').propertygrid({
				showGroup:true
			});
		}
		function hideGroup(){
			$('#pg').propertygrid({
				showGroup:false
			});
		}
		function showHeader(){
			$('#pg').propertygrid({
				showHeader:true
			});
		}
		function hideHeader(){
			$('#pg').propertygrid({
				showHeader:false
			});
		}
		function getChanges(){
			var s = '';
			var rows = $('#pg').propertygrid('getChanges');
			for(var i=0; i<rows.length; i++){
				s += rows[i].name + ':' + rows[i].value + ',';
			}
			alert("改动项：\n"+s);
		}
	</script>
</body>
</html>